/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package helloscala.practise.chapter5

import helloscala.practise.ChapterEntry

object Chapter5Entry extends ChapterEntry{
  def runTests: Unit = {
    testScopeVisibility
  }

  def testScopeVisibility = {
    //read ScopedClasses
  }

  def testParentChildWithoutTrait = {
    //without trait, the sub class must override all the auxiliary constructors
    //to keep consistency
    class RadioButtonWithCallbacks(
      var on: Boolean, label: String, clickedCallbacks: List[() => Unit])
          extends ButtonWithCallbacks(label, clickedCallbacks) {

      def this(on: Boolean, label: String, clickedCallback: () => Unit) =
          this(on, label, List(clickedCallback))

      def this(on: Boolean, label: String) = this(on, label, Nil)
    }

    val button = new RadioButtonWithCallbacks(false, "MyRadio", Nil)
    button.click
  }

  def testParanetChildWithTrait = {
    //no idea how to implement
  }
}
